package com.xqboss.web.core.config;

import cn.hutool.core.date.LocalDateTimeUtil;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

import java.time.LocalDateTime;

/**
 * <p>
 * 编码 -> 枚举 转化器工厂类
 * </p>
 * @author Trent
 * @date 2023/8/19
 */

public class LongToLocalDateTimeConverter implements Converter<Long, LocalDateTime> {

    @Override
    public LocalDateTime convert(Long source) {
        if(source == null){
            return null;
        }
        return LocalDateTimeUtil.of(source);
    }
}